import discover from "../pages/discover";
import friend from "../pages/friend";
import mine from "../pages/mine";

import { Redirect } from "react-router";

import Recommend from '../pages/discover/c-pages/recommend'
import Ranking from '../pages/discover/c-pages/ranking'
import Songs from '../pages/discover/c-pages/songs'
import Djradio from '../pages/discover/c-pages/djradio'
import Artist from '../pages/discover/c-pages/artist'
import Album from '../pages/discover/c-pages/album'


const routes = [
  {
    path:'/',
    exact:true,
    render: () => (
      <Redirect to="/discover"/>//重定向
    )
  },
  {
    path:'/discover',
    component:discover,
    routes: [
      {
        path: "/discover",
        exact: true,
        render: () => (
          <Redirect to="/discover/recommend"/>
        )
      },
      {
        path: "/discover/recommend",
        component: Recommend
      },
      {
        path: "/discover/ranking",
        component: Ranking
      },
      {
        path: "/discover/songs",
        component: Songs
      },
      {
        path: "/discover/djradio",
        component: Djradio
      },
      {
        path: "/discover/artist",
        component: Artist
      },
      {
        path: "/discover/album",
        component: Album
      }
    ]
  },
  {
    path:'/friend',
    component:friend
  },
  {
    path:'/mine',
    component:mine
  }
];

export default routes